package com.sly.demo.mapstruct.model.converter;

import cn.hutool.core.date.DateUtil;

import java.util.Date;

/**
 * 公共转换表达式
 *
 * @author SLY
 * @date 2022/8/7
 */
public class CommonExpression {

    public static String parseDateToDateTimeStr(Date date) {
        return DateUtil.formatDateTime(date);
    }

    public static String parseStatusToStatusStr(Integer status) {
        if (status == 1) {
            return "有效";
        }
        if (status == 0) {
            return "无效";
        }
        return null;
    }
}
